package logic_control;

import java.util.Scanner;

public class X {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入X的大小: ");
        int x = scanner.nextInt();
        int y = 0;
            for (int i = 1;i <= x;i++) {
                for (int j = 1;j <= x;j++) {
                    if (i == j||i == x-j+1) {
                        System.out.print("*");
                    }else {
                        System.out.print(" ");
                    }
                }
                System.out.println();
            }
    }
}
